<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta content="telephone=no" name="format-detection">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>微砍价</title>
		<link href="__PUBLIC__/Weixin/bargain/css/global.css" rel="stylesheet" type="text/css" /><link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/bootstrap/css/bootstrap.min.css">
		<link href="__PUBLIC__/Weixin/bargain/css/global2.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="__PUBLIC__/Weixin/bargain/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/Weixin/bargain/js/global.js"></script>
		<link href="__PUBLIC__/Weixin/bargain/css/bargain.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="__PUBLIC__/Weixin/bargain/js/bargain.js"></script>
		<link href="__PUBLIC__/Weixin/bargain/css/idangerous.swiper.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="__PUBLIC__/Weixin/bargain/js/idangerous.swiper-1.9.1.min.js"></script>
		<style>
			.cont img{max-width:100%}
		</style>
	</head>
	<body>
		<script language="javascript">$(function(){bargain_obj.detail_init()});</script>
		<div class="product_detail">
			<div class="product_banner">
				<div class="swiper-container">
					<div class="swiper-wrapper">
						<div class="swiper-slide">
							<a href="{$bargain.logourl1}"><img src="__PUBLIC__{$bargain.logoimg1}" alt=""></a>
						</div>
						<if condition="$bargain.logoimg2 neq ''">
						<div class="swiper-slide">
							<a href="{$bargain.logourl2}"><img src="__PUBLIC__{$bargain.logoimg2}" alt=""></a>
						</div>
						</if>
						<if condition="$bargain.logoimg3 neq ''">
						<div class="swiper-slide">
							<a href="{$bargain.logourl3}"><img src="__PUBLIC__{$bargain.logoimg3}" alt=""></a>
						</div>
						</if>
					</div>
				</div>
			</div>
			<h3>{$bargain.name}</h3>
			<div class="info">
				<span>底价:￥<font>{$bargain.minimum}</font></span><span>原价:￥<font>{$bargain.original}</font></span>
			</div>
			<div class="stock_volume"><span>库存<span id="stock_">{$bargain.inventory}</span></span><span>销量<span id="sale_">{$paynum}</span></span></div>
		</div>
		<div class="description">
			<h3 class="t">商品详情</h3>
			<div class="cont">{$bargain.info|htmlspecialchars_decode}</div>
		</div>
		<div class="description">
			<h3 class="t">活动规则</h3>
			<div class="cont">{$bargain.guize|htmlspecialchars_decode}</div>
		</div>
		<div class="join_bar_blank"></div>
		<div id="join_bar">
			<div class="price"><span>底价:￥<font>{$bargain.minimum}</font></span><span>原价:￥<font>{$bargain.original}</font></span></div>
			<?php if($type == "noorder"){?>
			<div class="btn"><a href="<?php echo U('Bargain/dao',array('token'=>$token,'id'=>$_GET['id']));?>">立即砍价</a></div>
			<?php }else{?>
			<div class="btn"><a href="<?php echo U('Bargain/dao',array('token'=>$token,'id'=>$_GET['id']));?>">我的砍价</a></div>
			<?php }?>
			<div class="clear"></div>
		</div>
		<script type="text/javascript">
		window.shareData = {
			"moduleName":"Bargain",
			"moduleID":"<?php echo $bargain['pigcms_id'];?>",
			"imgUrl": "http://<?php echo $siteurl;?>__PUBLIC__<?php echo $bargain['logoimg1'];?>",
			"sendFriendLink": "<?php echo U('Bargain/index',array('token'=>$token,'id'=>$bargain['id'], 'aff_id' => $_SESSION['memberInfo']['id']),true,false,true);?>",
			"tTitle": "<?php echo $bargain['name'];?>",
			"tContent": "<?php echo $bargain['wxinfo'];?>"
		};
		</script>

	</body>












<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script type="text/javascript">




$.get('<?php echo U('Home/Ajax/getStockAndSale');?>',{id:<?php echo $bargain['product_id'];?>},function(data){
			$('#sale_').html(data.sale);
			$('#stock_').html(data.stock);
		},'json');






//请求关注提醒信息
$.post('<?php echo U('Home/Ajax/getJsSdk');?>',{url:window.location.href},function(data){
	//$(document).find('body').append(data);
	//alert(data.signature);
	//alert(data.rawString);
	wx.config({
		//debug: true,
		appId: data.appId,
		timestamp: data.timestamp,
		nonceStr: data.nonceStr,
		signature: data.signature,
		jsApiList: [
		  // 所有要调用的 API 都要加到这个列表中

		  'onMenuShareTimeline',
		  'onMenuShareAppMessage',

		]
	});
	wx.ready(function () {
	  var shareData = {
		title: window.shareData.tTitle,
		desc: window.shareData.tContent,
		link: window.shareData.sendFriendLink,
		imgUrl: window.shareData.imgUrl,
		success: function () {
        // 用户确认分享后执行的回调函数
		    $.post('<?php echo U('Ajax/weixinshare');?>',{url:'<?php echo U('', array('aff_id' => $_SESSION['memberInfo']['id']), true, false, true);?>'}, function(){
				//success('分享成功！');
			});
        }};
	  wx.onMenuShareAppMessage(shareData);
	  wx.onMenuShareTimeline(shareData);
	});
},'json');

  </script>



</html>